package cn.pn.project.mapper.order;

import cn.pn.project.pojo.order.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface OrderMapper {

    /**
     * 根据订单 Id/编号 查询订单信息
     * @param mainOrderId
     * @param orderNum
     * @return
     * @throws Exception
     */
    public Order getOrderById(@Param(value = "mainOrderId")Integer mainOrderId,@Param(value = "orderNum") String orderNum)throws Exception;

    /**
     * 多条件查询订单信息（分页）
     * @param param
     * @return
     * @throws Exception
     */
    public List<Order> getOrderListByMap(Map<String,Object> param)throws Exception;

    /**
     * 多条件查询订单数量
     * @param param
     * @return
     * @throws Exception
     */
    public Integer getOrderCountByMap(Map<String,Object> param)throws Exception;

    /**
     * 新增订单信息
     * @param order
     * @return
     * @throws Exception
     */
    public Integer insertOrder(Order order)throws Exception;

    /**
     * 修改订单信息
     * @param order
     * @return
     * @throws Exception
     */
    public Integer updateOrder(Order order)throws Exception;

    /**
     * 删除订单(修改订单是否为删除状态)
     * @param mainOrderId
     * @param orderNum
     * @return
     */
    public Integer deleteOrderById(@Param(value = "mainOrderId")Integer mainOrderId,@Param(value = "orderNum") Integer orderNum)throws Exception;

}
